<template>
    <div>
        <div class="title">猜你喜欢</div>
        <ul>
          <!-- <router-link to="/detail"> -->
            <router-link tag="li"
            class="item border-bottom"
            v-for="recommend of list" v-bind:key="recommend.id"
            v-bind:to="'/detail/' + recommend.id">
                <img class="item-img" v-bind:src="recommend.imgURL"/>
                <div class="item-info">
                    <p class="item-title">{{recommend.title}}</p>
                    <p class="item-desc">{{recommend.desc}}</p>
                    <button class="item-button">查看详情</button>
                </div>
            </router-link>
          <!-- </router-link> -->
        </ul>
    </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  },
  data () {
    return {
      // recommendList: [{
      //   id: '001',
      //   imgURL: 'http://img1.qunarzz.com/sight/p0/1905/e6/e683c8cf5e97ce03a3.img.jpg_200x200_4769276c.jpg',
      //   title: '世界之窗',
      //   desc: '国际啤酒节清凉一夏，夜场49.9元'
      // }, {
      //   id: '002',
      //   imgURL: 'http://img1.qunarzz.com/sight/p0/1907/79/79e4ff041bd3d2a3a3.water.jpg_200x200_95356ed7.jpg',
      //   title: '深圳欢乐谷',
      //   desc: '玛雅水公园，夏日玩水好去处'
      // }, {
      //   id: '003',
      //   imgURL: 'http://img1.qunarzz.com/sight/p0/1507/64/34362835b4a219af8b36803d31a6380f.water.jpg_200x200_bc5c0452.jpg',
      //   title: '深圳小梅沙海洋世界',
      //   desc: '帅的人都去过了😎，你还等什么~'
      // }, {
      //   id: '004',
      //   imgURL: 'http://img1.qunarzz.com/sight/p0/1508/2e/d9363ce50a88c8c5ff5a138c67687cd4.water.jpg_200x200_1c15c8f5.jpg',
      //   title: '深圳野生动物园',
      //   desc: '放养式动物园让你和动物们“零距离”'
      // }]
    }
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl'
  .title
    margin-top: .2rem
    line-height: .8rem
    background: #eee
    text-indent: .2rem
  .item
    overflow: hidden
    display: flex
    height: 1.9rem
    .item-img
      width: 1.7rem
      height: 1.7rem
      padding: .1rem
    .item-info
      text-align left
      flex: 1
      padding: .1rem
      min-width: 0
      .item-title
        line-height: .54rem
        font-size: .32rem
        ellipsis()
      .item-desc
          line-height: .4rem
          color: #aaa
          ellipsis()
      .item-button
        line-height: .44rem
        margin-top: .16rem
        background: #ff9300
        padding: 0 .1rem
        border-radius: .06rem
        color: #fff
</style>
